#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>

void insert_sort(int arr[], int sz)
{
	for (int i = 1; i < sz - 1; i++)
	{
		int end = i - 1;
		int key = arr[i];
		while (end >= 0 && arr[end] > key)
		{
			arr[end + 1] = arr[end];
			end--;
		}
		arr[end + 1] = key;
	}
}


int main()
{
	int arr[] = { 5,8,2,6,9,3,4,1,7,10 };
	int sz = sizeof(arr) / sizeof(arr[0]);
	insert_sort(arr, sz);
	int i = 0;
	for (i = 0; i < sz; i++)
	{
		printf("%d ", arr[i]);
	}
	return 0;
}